Repository navigation
Conversation
Regression test report ✅Commit: Selected 3 changed tests (limit=20, 0 not selected) 8 tests: regression=6 unreleased=0 coverage=2 failing=0
TestAccept/bundle/resources/schemas/foreign_at_recorded_name/DMS=: branch ✅ | main (e6f3460) ❌ | latest (v1.28.0) ❌main (e6f3460): latest (v1.28.0): TestAccept/bundle/resources/schemas/foreign_at_recorded_name/DMS=true: branch ✅ | main (e6f3460) ❌ | latest (v1.28.0) ❌main (e6f3460): latest (v1.28.0): TestAccept/bundle/resources/schemas/recreated_at_recorded_name/DMS=: branch ✅ | main (e6f3460) ❌ | latest (v1.28.0) ❌main (e6f3460): latest (v1.28.0): TestAccept/bundle/resources/schemas/recreated_at_recorded_name/DMS=true: branch ✅ | main (e6f3460) ❌ | latest (v1.28.0) ❌main (e6f3460): latest (v1.28.0): 2 more failure details omitted, see the full report in the run. |
✅ Integration test reportCommit: d91d668
Top 6 slowest tests (at least 2 minutes):
|
There was a problem hiding this comment.
Automated review at 87ab7b3. Each finding was verified against the code.
Not ready yet: 2 blocking issue(s), tagged [blocking].
This PR makes the direct engine compare schema_id/volume_id before updating or deleting a schema or volume, and makes delete look for one that was renamed out of band (catalog/schema listing plus the follow-the-renamed-parent pass). The identity check on the plan side does what it should. The new parent-follow path in findInMovedParents has two real holes. It can send a DELETE to a volume that is not the bundle's. And because it relies only on depends_on, it can let a schema force-delete take a prevent_destroy volume with it. The rest are comment and wording fixes.
andrewnester
left a comment
There was a problem hiding this comment.
Holding my approval until the open thread on bundle/direct/bundle_plan.go is settled.
There was a problem hiding this comment.
Automated review at 87ab7b3. Each finding was verified against the code.
No blocking issues found. 7 non-blocking comment(s) below.
This PR makes the direct engine check schema_id/volume_id before it updates or deletes a schema or volume, and it lets destroy find the bundle's own object after an out-of-band rename, either through DoFindByInternalID or under a parent that has moved. The main fix holds up in the code and the acceptance tests. The edge most worth fixing is how findInMovedParents maps a child to its moved parent: it can send a DELETE to a volume that isn't the bundle's, and a case-sensitive prefix match can miss a protected volume entirely. The rest are smaller points about the changelog, stale comments and repo conventions.
Comments outside the changed lines
- [nice to have]
bundle/direct/bundle_plan.go:1011: A schema renamed by the bundle to a mixed-case name is saved at UC's lowercasedresponse.FullName(DoUpdateWithID), while its volume's state-onlyRekeysavesIDFromStatein config case (main.MixedSchema.v). After a later out-of-band rename of the schema,CutPrefix("main.MixedSchema.v", "main.mixedschema.")misses. The volume stays Gone, and the schema's force delete removes it without itsprevent_destroybeing checked. Should this compare the parent components case-insensitively, with a test for that sequence?
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Opus 5.5 + Claude Opus 5.5 + Claude Sonnet 5.5, cross-verified). Only points the reviewers agreed on are posted.
…the recorded name A schema or volume someone else created under the recorded name, after ours was renamed out of band, was planned as an update and deleted by destroy. The plan now treats it as not ours. Destroy, which has no config to give a renamed resource's new name, finds it by its internal id (listing the parent) and deletes it there. Co-authored-by: Isaac <no-reply@databricks.com>
…e other object Address review: a failed search or identity read fails the plan instead of dropping the state entry or deleting at the recorded name; ID-only state entries skip the check; one helper compares internal ids for findMoved and findByInternalID; a warning names the object left alone and how to take it over; the replay helper maps lowercased UC names. Co-authored-by: Isaac <no-reply@databricks.com>
…ours is not found A volume in a schema renamed out of band was dropped from state and went with the schema's force delete, past its prevent_destroy. Look it up under the parent's new name and delete it as itself. Warn about the other object only when the bundle's own is not found elsewhere, and document that a resource deleted and created again out of band needs rebinding. Co-authored-by: Isaac <no-reply@databricks.com>
…arent's new one Address review: map the child's ID by its parent's ID prefix instead of by field value (a schema named like its catalog); follow a parent re-keyed in a deploy too; and when the parent is deleted, delete the child at its new ID even if not found there, so prevent_destroy applies. Co-authored-by: Isaac <no-reply@databricks.com>
aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
…struct) aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
…full name Address review on #8056: - a child under a parent deleted at a moved ID that cannot be verified there (models and secrets included) gets with_parent: listed, counted and checked for prevent_destroy, but no delete is sent at the guessed name; - parents are matched by case-insensitive full-name prefix over every UC resource the plan found at a moved ID, not through depends_on; - warnings are diagnostics, a Delete's is told after the parent pass, and errors name schema_id/volume_id; - comments, README and changelog updated; schema_fields/volume_fields helpers for the new tests. Co-authored-by: Isaac <no-reply@databricks.com>
…nts for any child Address the review round on #8056: - a with_parent child is applied after its parent's delete and selected with it, so its state is dropped only once that delete succeeded; - a child of any type under a moved parent is looked for there, and one without an internal ID that is not there stays Gone; - a child at its old path under a moved parent is never deleted there; - a 403 at the recorded ID searches by internal ID first; - the completed plan is checked for cycles again; doc fixes. Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
A child whose recorded read was forbidden and not found by its internal ID is looked for under the moved parent too; an entry found at its recorded ID is re-targeted only for UC full-name types, so a secret scope named like a schema is deleted where it is. Co-authored-by: Isaac <no-reply@databricks.com>
It sends no request, so its other delete edges are not needed; one to a sibling in the same parent closed a cycle through the parent. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/schemas/destroy_renamed_with_model_and_secret TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/volumes/removed_from_renamed_schema TestAccept/bundle/resources/volumes/prevent_destroy_schema_without_dependency TestAccept/bundle/resources/volumes/prevent_destroy_mixed_case_schema TestAccept/bundle/resources/volumes/select_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
87ab7b3 to
c33cefa
Compare
|
🤖 Addressed all review comments on 87ab7b3 in one push,
A second review round on this push (two more independent reviewers and a devil's-advocate pass) found and closed more instances of the same classes: a child left at its old path under a moved parent, a secret scope named like the schema, a cycle through a sibling, and a parent delete that fails. Each has a test that fails without the fix. The cloud tests passed on AWS locally, and the last commit names them for the PR's cloud run. One open question for an owner, in "Gaps and risks": should this PR bump AI agent (opus5.5, isaac_claude) |
|
/review |
There was a problem hiding this comment.
Automated review at c33cefa. Each finding was verified against the code.
Not ready yet: 1 blocking issue(s), tagged [blocking].
This PR makes the direct engine check schema_id/volume_id before updating or deleting a schema or volume. Destroy can now find the bundle's own object after a rename out of band, and children of a renamed parent are tracked through the new with_parent field. The main fix holds up when traced through the code, but one gap remains: the prefix lookup under a moved parent can still delete an unrelated secret scope at a guessed name, and that should be fixed before merge. The rest are smaller issues: delete ordering for with_parent entries, --select widening to a forced schema delete, and some test-convention items.
Questions
- Saved plans can now carry a Delete
idthat apply honours and a newwith_parentfield, whilecurrentPlanVersionstays 2. A plan saved by the previous CLI has noidfor its Delete, so after a rename out of band this CLI would delete the other schema at the recorded name. Shouldplan_versionbe bumped so mixed-version plans are rejected, or is the change inbundle plan -o jsonoutput the reason to keep it? (non-blocking)
There was a problem hiding this comment.
Automated review at 29e7309. Each finding was verified against the code.
Not ready yet: 1 blocking issue(s), tagged [blocking]; 1 open question(s) about a change users could be hurt by.
This PR makes the direct engine check schema_id/volume_id before it updates or deletes a schema or volume. Destroy now searches for the bundle's object by internal ID after an out-of-band rename, and children of a moved parent are either deleted at their new path or marked with_parent. The core identity check holds up. One gap undermines the safety goal: a model renamed together with its schema loses its prevent_destroy protection while the schema's forced delete removes it. Smaller issues: saved plans are still compatible across CLI versions, one test stubs a modelled route, and the new search warning text is misleading.
Questions
- [blocking] A schema or volume with an internal ID that returns 404 at its recorded ID now triggers a full catalog (or schema) listing. The most common cause is a plain out-of-band delete, and that used to be a single GET followed by
Gone. Any non-404/403 error from that listing or from the read now fails destroy where it used to succeed (bundle_plan.go1278, 1287). Should the search be limited (for example only when another object sits at the recorded name, or only for a 403), or should these errors stay warnings on the destroy path?
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Follow-up review by review-factory (Claude Opus 5.5 + Claude Opus 5.5 + Claude Sonnet 5.5, cross-verified). Only points the reviewers agreed on are posted.
No new issues found.
- A child under a parent deleted at a moved ID that is not verified there gets with_parent, also on a 404 and without an internal ID: a 404 cannot tell a model renamed too from one deleted. - The search warning says what was searched; the Action.Gone comment matches PlanEntry.Gone. - Tests: registered_models/prevent_destroy_in_renamed_schema, registered_models/removed_from_renamed_schema; fault.py instead of [[Server]] stubs in destroy_forbidden_at_recorded_name. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/schemas/destroy_renamed_with_model_and_secret TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/volumes/removed_from_renamed_schema TestAccept/bundle/resources/volumes/prevent_destroy_schema_without_dependency TestAccept/bundle/resources/volumes/prevent_destroy_mixed_case_schema TestAccept/bundle/resources/volumes/select_renamed_schema TestAccept/bundle/resources/registered_models/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/registered_models/removed_from_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 Addressed the review on On the question in the review body (a plain out-of-band delete now triggers a listing, and a failing listing fails destroy): this is deliberate, and it is listed in "Gaps and risks".
If an owner prefers the warning, it is a small change in AI agent (opus5.5, isaac_claude) |
|
/review |
There was a problem hiding this comment.
Automated review at 69e2c19. Each finding was verified against the code.
No blocking issues found. 5 non-blocking comment(s) below.
This PR makes the direct engine check schema_id/volume_id before it updates or deletes a schema or volume. Destroy now finds the bundle's object by internal ID after a rename out of band, and children of a moved parent are either deleted at their new path or marked with_parent. The identity check closes the data-loss case it targets, and the acceptance coverage is thorough. Remaining issues: the plan version stays at 2 even though older CLIs read these plans differently, there is a gap in delete ordering for with_parent dependencies across two renamed parents, and a few wording and test-layout nits.
| @@ -0,0 +1,7 @@ | |||
| Cloud = true | |||
There was a problem hiding this comment.
[nit] This file is identical in about ten of the new or changed tests under registered_models/, schemas/ and volumes/. .agents/rules/testing.md asks to put common test.toml options in a parent directory, and it says .databricks and .gitignore are already removed by acceptance/script.cleanup. Could the shared Ignore move to a parent test.toml, without those two entries?
There was a problem hiding this comment.
🤖 Since the narrowing, three tests in this PR have this file. Ten tests already on main under schemas/ have the same test.toml, .databricks and .gitignore entries included (for example rename_out_of_band, recreate_out_of_band, rename_with_volume_ref). These three follow that convention. A parent test.toml for schemas/ and volumes/ would change every test in those directories, so I'd leave it to a separate cleanup and not change it here.
AI agent (opus5.5, isaac_claude)
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Follow-up review by review-factory (Claude Opus 5.5 + Claude Opus 5.5 + Claude Sonnet 5.5, cross-verified). Only points the reviewers agreed on are posted.
…rents move to a follow-up Keep: a schema or volume at the recorded name with another schema_id/volume_id is never updated or deleted; deploy falls through to findMoved, a delete drops the state entry and warns. Move to the follow-up: DoFindByInternalID and the list routes, findInMovedParents, with_parent, the makeGraph and --select handling, Destroy at a moved ID, and their tests. destroy_after_rename_out_of_band is back to main, Badness note included. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/volumes/foreign_at_recorded_name Co-authored-by: Isaac <no-reply@databricks.com>
… resources in it Restores what was narrowed out of #8056: DoFindByInternalID (schemas, volumes) with the testserver list routes, findInMovedParents, the with_parent plan field and its makeGraph and --select handling, Destroy at a moved ID, and their tests. Removes the Badness notes of destroy_after_rename_out_of_band and foreign_at_recorded_name. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/schemas/destroy_renamed_with_model_and_secret TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/volumes/removed_from_renamed_schema TestAccept/bundle/resources/volumes/prevent_destroy_schema_without_dependency TestAccept/bundle/resources/volumes/prevent_destroy_mixed_case_schema TestAccept/bundle/resources/volumes/select_renamed_schema TestAccept/bundle/resources/registered_models/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/registered_models/removed_from_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
|
🤖 This PR is now narrowed to the identity check, in Why: every blocking finding in the review rounds was in the half that handles resources inside a renamed schema. Each round found one more edge case, so it was not converging. The identity check itself has had no blocking finding since the first round. The two halves fix different things: this one stops a wrong delete of someone else's schema, the other fixes a leak. Stays here:
Moved to #8096:
The threads about the moved code are all resolved here, and their fixes are in #8096. They include:
The question in the last review's body, about the search failing a destroy, also moved.
The narrowing is easy to undo: #8096's branch is this PR plus one commit, and its tree is the full version that was reviewed here. Checks: the unit tests, lint and the bundle acceptance suite pass locally. The one exception is AI agent (opus5.5, isaac_claude) |
|
/review |
There was a problem hiding this comment.
Automated review at 30938bb. Each finding was verified against the code.
No blocking issues found. 4 non-blocking comment(s) below.
This PR makes the direct engine compare a schema's schema_id or a volume's volume_id before it updates or deletes whatever sits at the recorded name. That fixes bundle destroy deleting a schema someone else created under the bundle's old name. The core check is correct: otherInternalID sends deploy to findMoved or a create, and sends delete to a gone entry with no DELETE request. My remaining comments cover a create that is planned even though it can only fail, warning advice that doesn't fit every case, and two test goldens that don't show what their titles claim.
| return false | ||
| } | ||
| } | ||
| if otherID != "" && remoteState == nil { |
There was a problem hiding this comment.
[nice to have] When the config still gives the recorded ID, findMoved returns right away (id == storedID), so the plan becomes a create at a name where we just read another object. This happens in both the recreated case and the foreign case when the config is unchanged. bundle plan then exits 0 with "1 to add", and bundle deploy uploads files before it fails with SCHEMA_ALREADY_EXISTS, as both goldens show. Should this be a plan error with the same message when the config's ID equals dbentry.ID, and stay a warning only when the create targets a different name?
There was a problem hiding this comment.
🤖 I'd keep this a warning plus a planned create, and not change it in this PR. The create is what the plan honestly is: the bundle's schema is not at the name the config gives, and the plan does not update or delete what is there. A plan error would make bundle plan fail for the whole bundle over one resource, and the user would see the same message either way. The one cost is the file upload before the create fails, which the goldens show. If owners prefer to fail at plan time, it is a small change (when findMoved returns nothing and the config's ID equals the recorded one), and it can go in on its own.
AI agent (opus5.5, isaac_claude)
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
… resources in it Restores what was narrowed out of #8056: DoFindByInternalID (schemas, volumes) with the testserver list routes, findInMovedParents, the with_parent plan field and its makeGraph and --select handling, Destroy at a moved ID, and their tests. Adds its own changelog fragment (schema-moved-parent.md); #8056's fragment is unchanged. Removes the Badness notes of destroy_after_rename_out_of_band and foreign_at_recorded_name. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/schemas/destroy_renamed_with_model_and_secret TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/volumes/removed_from_renamed_schema TestAccept/bundle/resources/volumes/prevent_destroy_schema_without_dependency TestAccept/bundle/resources/volumes/prevent_destroy_mixed_case_schema TestAccept/bundle/resources/volumes/select_renamed_schema TestAccept/bundle/resources/registered_models/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/registered_models/removed_from_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
… resources in it Restores what was narrowed out of #8056: DoFindByInternalID (schemas, volumes) with the testserver list routes, findInMovedParents, the with_parent plan field and its makeGraph and --select handling, Destroy at a moved ID, and their tests. Adds its own changelog fragment (schema-moved-parent.md); #8056's fragment is unchanged. Removes the Badness notes of destroy_after_rename_out_of_band and foreign_at_recorded_name. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/schemas/destroy_renamed_with_model_and_secret TestAccept/bundle/resources/volumes/foreign_at_recorded_name TestAccept/bundle/resources/volumes/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/volumes/removed_from_renamed_schema TestAccept/bundle/resources/volumes/prevent_destroy_schema_without_dependency TestAccept/bundle/resources/volumes/prevent_destroy_mixed_case_schema TestAccept/bundle/resources/volumes/select_renamed_schema TestAccept/bundle/resources/registered_models/prevent_destroy_in_renamed_schema TestAccept/bundle/resources/registered_models/removed_from_renamed_schema Co-authored-by: Isaac <no-reply@databricks.com>
…at the recorded ID - Deploy suggests pointing the config at the renamed object, or unbind and bind; delete says no delete is sent and suggests deleting it outside the bundle. - The Gone comments mention another object at the recorded ID. - foreign_at_recorded_name and recreated_at_recorded_name show the failed deploy's requests; the plan step uses plan_filter.py. aws: TestAccept/bundle/resources/schemas/foreign_at_recorded_name TestAccept/bundle/resources/schemas/destroy_after_rename_out_of_band TestAccept/bundle/resources/schemas/recreated_at_recorded_name TestAccept/bundle/resources/volumes/foreign_at_recorded_name Co-authored-by: Isaac <no-reply@databricks.com>
|
/review |
There was a problem hiding this comment.
Automated review at d91d668. Each finding was verified against the code.
No blocking issues found. 2 non-blocking comment(s) below.
This PR makes the direct engine compare a schema's schema_id or a volume's volume_id before it updates or deletes whatever sits at the recorded name. If the IDs differ, the object is treated as not the bundle's: the plan creates instead of updating, and destroy only drops the state entry. The identity check looks correct, and so do its interactions with findMoved and with ID-only state entries. The two points below are about wording: the README and changelog promise more than the code delivers when a bundle-managed parent schema is force-deleted, and one doc comment describes only one of its two callers.
Comments outside the changed lines
- [nice to have]
bundle/direct/dresources/README.md:768: "it only drops the state entry and leaves the other object in place" doesn't hold when the bundle also manages the parent schema. Take a bundle with schemas1and volumev1in it, wherev1was renamed out of band and someone else created a volume ats1.v1.destroymarksv1gone, butResourceSchema.DoDelete(dresources/schema.go) still sendsForce: truefors1, which deletes the other volume. The changelog in.nextchanges/bundles/schema-volume-identity.mdmakes the same promise ("bundle destroyno longer deletes it"). Can both say this only applies when the parent schema isn't deleted in the same destroy? While you're editing the changelog, splitting that long sentence into two entries would make it easier to read.
| } | ||
|
|
||
| // otherObjectMessage says that what is at the recorded ID id is not the bundle's. It is told when | ||
| // the bundle's own is not found elsewhere either; a resource deleted and created again out of band |
There was a problem hiding this comment.
[nit] "It is told when the bundle's own is not found elsewhere either" is true for the deploy caller, but otherObjectAtRecordedID never looks elsewhere (its own comment says "The bundle's own is not looked for"). Maybe: "otherObjectMessage describes the object at the recorded ID id, whose internal ID is otherID and not the one savedState records. Callers add the advice, because a resource deleted and created again out of band looks the same."
Sankalp-Mittal
left a comment
There was a problem hiding this comment.
[AI Generated] Follow-up review by review-factory (Claude Sonnet 5.5 + Claude Opus 5.5 + Claude Opus 5.5, cross-verified). Only points the reviewers agreed on are posted.
No new issues found.
Changes
The direct engine now checks a schema's
schema_idor a volume'svolume_idbefore it updates or deletes what is at the recorded name. An object there with a different internal id is someone else's, or the bundle's was deleted and created again: the CLI never updates or deletes it.findMovedlookup at the config's ID, so it finds the bundle's object when the config follows the rename. Otherwise it plans a create, which fails on the name. A warning (a diagnostic) names the object and the ways out: point the config at the renamed object, or unbind and bind.acceptance/bin/replay_tfstate.py: matches a create request to its tfstate entry case-insensitively. UC lowercases names, so a mixed-case schema'sschema_idwas not remapped on replay, and the migrated state carried a stale id that the new check rejected (migrate/auto/schema-name-normalized).This PR was narrowed to the identity check during review. Finding a renamed schema or volume by its internal id on destroy, and handling the resources inside a renamed schema, moved to the follow-up #8096.
Why
This PR fixes the destructive half of the behavior recorded as Badness in
acceptance/bundle/resources/schemas/foreign_at_recorded_name:Before, the plan was
"action": "update"on the other schema (schema_id: [FOREIGN_SCHEMA_ID]) and destroy sentDELETE /api/2.1/unity-catalog/schemas/main.test-schema-[UNIQUE_NAME]. Now the plan is"action": "create"with a warning, deploy fails withSCHEMA_ALREADY_EXISTS, and destroy sends no DELETE:Destroy: 0 deleted, with a warning. The other schema is left alone.The rest of that note, the bundle's renamed schema being left behind, is still true. The test keeps a narrower Badness note for it, and so does the new
volumes/foreign_at_recorded_name.schemas/destroy_after_rename_out_of_bandis unchanged and keeps its Badness note. Both are fixed in the follow-up.Tests
schemas/foreign_at_recorded_name: the Badness note is narrowed to the leak; the destroy step now shows that nothing is deleted.volumes/foreign_at_recorded_name(the same for volumes), andschemas/recreated_at_recorded_name(documents the behavior change below, and that unbind + bind recovers).otherInternalID,otherObjectAtRecordedID(ID-only state entries, no recorded internal id).bundle_plan.go). The Cloud tests passed on AWS locally.Gaps and risks
Overall risk: low. The change only narrows what the CLI updates or deletes, and touches only schemas and volumes, the two resources with an internal id today.
Judgment call: a schema or volume deleted and created again outside the bundle is no longer adopted. The CLI cannot tell it from an object someone else created under the same name: both have another
schema_id/volume_idat the recorded name. Adopting it silently is what let destroy delete other people's schemas, so it is now left alone: deploy fails withALREADY_EXISTSand destroy drops it from the state, until the user runsbundle deployment unbindandbundle deployment bind. A warning on every plan names the object and the way out, andschemas/recreated_at_recorded_nameshows the recovery. Risk: medium. A user who drops and recreates schemas by hand sees deploys fail where they used to succeed; nothing is deleted or changed in the workspace.Destroy still leaves a schema or volume renamed out of band behind, now also when another object took its old name; it drops the state entry and warns. That is a leak, not a wrong delete, and the follow-up fixes it. Risk: low.
plan_version: this PR adds no plan field and no new meaning to one. A plan saved by an older CLI and applied by this one deletes at the recorded name without the check, as that CLI would; a plan saved by this one marks the other object's deletegone, which an older CLI already honors. A saved plan means the same to both CLIs, so a bump would only reject plans without protecting anything; this PR does not bump it. The question comes back in #8096, where a Delete'sidgets a new meaning.bundle deployment binddoes not record the internal id; the next deploy does. Until then the check has nothing to compare, as with state from an older CLI. Risk: low.Related PRs
apply.go) has merged; this PR no longer changesapply.go.Dashboard
"action": "update"on the schema with[FOREIGN_SCHEMA_ID], thenDELETE /api/2.1/unity-catalog/schemas/main.test-schema-[UNIQUE_NAME]🤖 AI agent (opus5.5, isaac_claude)
This pull request and its description were written by Isaac.